/**
 * Created by LeungZ on 2016/10/17.
 */
import imgTemp from './image.html';
import imgCtrl from './image.ctrl.js';

import './build/build.scss';
import buildTemp from './build/build.html';
import buildCtrl from './build/build.ctrl.js';

export default angular.module('ctg-k8sconsole').config(['$stateProvider', $stateProvider=> {
    $stateProvider.state('image-upload', {
        url: '/image/upload',
        templateUrl: imgTemp,
        controller: imgCtrl,
        controllerAs: 'list',
        resolve:{
            list:['appSrv', 'ctgNotification', function (appSrv, ctgNotification) {
                return appSrv.getBuildList({currentPage: 1}).catch(function (data) {
                    ctgNotification.error('获取构建列表数据有误.');
                });
            }]
        }
    })
}]);